<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Rental Change Request</title>
<?php
	include('Connection.php');
?>
</head>

<body>
	<h1>Rental Change Request</h1><br />
    
    <table width="100%">
    	<tr>
        	<td>
                <form method="post" action="lookup_res.php">
                    Enter Username: <input type="text" name="date_username"><br /><br />
                    
                    <input type="submit" value="View Rental Information">
                </form><br /><br />
    		</td>
            
            <td>
            	<h2>User Affected</h2>
            </td>
        </tr>

		<tr>
        	<td>
                <form name="rent_change" action="">
                    
                    <h2>Rental Information</h2>
                    
                    Car Model: <input type="text" name="car_model" readonly><br /><br />
                    
                    Car Location: <input type="text" name="car_loc" readonly><br /><br />
                    
                    Original Return Time:
                    <input type="text" value="
                    
                    	<?php
							$username = $_POST['username'];
							$date = time();//current system time
							
							//return reservation ReturnDateTime that has a PickupDateTime before current system time
							$date = "SELECT ReturnDateTime FROM reservation WHERE Username='$username' 
									  AND  '$time' < ReturnDateTime";
									  
							$result = mysql($date);		   
							
							echo($_SESSION['return_date']);
						?>
                        "
                    ><br /><br />
                    
                    New Arrival Time: 
                    <select name="arrive_date">
                    	<?php
							$currDate = 0;
							for($i = 0; $i < 14; $i++){
								echo '<option value="'.$i.'">'.$row[LocationName].'</option>';
							}
						?>
                    </select>
                    
                </form>
    		</td>
    	</tr>
    </table>

</body>
</html>